﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;

namespace Ewts.ashx
{
    /// <summary>
    /// Casc 的摘要说明
    /// </summary>
    public class Cum : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string str = "";
            
            if (context.Request["loadid"] != null)
            {
                string iotype = context.Request["iotype"];
                switch(iotype){
                    case "inish":
                        FinishLoad(context.Request["loadid"]);
                        break;
                    default:
                        break;

                }
            }
            context.Response.Write(str);
        }

        /// <summary>
        /// 完成Load
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public void FinishLoad(string loadid)
        {
            DataLib.BLL.load_att bll = new DataLib.BLL.load_att();
            DataLib.Model.load_att model = new DataLib.Model.load_att();
            model = bll.GetLModel(int.Parse(loadid));
            if (model != null)
            {
                model.loadState = 4;
                model.loadfinishdate = DateTime.Now;
                bll.Update(model);
            }
        }



     
 
        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}